<!doctype html>
<html>
<head>
    <meta charset="utf-8">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta name="viewport" content="width=device-width,initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no"/>
    <meta content="yes" name="apple-mobile-web-app-capable">
    <meta content="black" name="apple-mobile-web-app-status-bar-style">
    <meta content="telephone=no" name="format-detection">
    <title>2级推荐人</title>
    <link rel="stylesheet" href="../css/base.css">
    <script src="../js/jquery-1.11.3.min.js" ></script>
    <script src="../js/paramsTool.js" ></script>

</head>
<style type="text/css">
    .top{width:100%; height:60px; line-height:60px; text-align:center; background:#CB3536; color:#fff; font-size:18px;}

    .listnum1{background:#f7f7f7;width:100%;height:30px; line-height:30px;border-top:1px solid #ddd;border-bottom:1px solid #ddd;}
    .listnum1 .left{float:left;width:40%;color:#898989;margin-left:20px;font-size:14px;}
    /***战友团明细***/
    .infoline_bands{width:100%;height:58px;padding:1px 0;border-bottom: solid #f0efef 1px; display:block; overflow:hidden;background:#fff; font-weight:100;}
    .infoline_bands .infopic{width:40px; float:left; padding:6px 10px;}
    .infoline_bands .infopic img{width:40px; height:40px;border-radius:100%; border:1px solid #CCC;margin:3px 0 0 0px;}
    .infoline_bands .infotxt{float:left; text-align:left; margin-top: 7px; line-height: 1.5; }
    .infoline_bands .infotxt .name{padding-top:5px;text-align:left; font-weight:bold; font-size:12px;float:left;overflow:hidden; color:#000;}

    .infoline_bands .infotxt .time{padding:0px 2px 0 0; clear:both; min-height:18px;text-align:left; font-size:10px; float:left;display:block; font-weight:bold; overflow:hidden;}


</style>
<script>
    var host = window.location.origin;
    var openid = getCookie('wxopenid');
    if(!openid){
        getWxCode();
    }
    $(function () {
        openid = getCookie('wxopenid');
        $.ajax({
            url: host+ "/getReferee2Info",
            type: "get",
            dataType:'json',
            async:true,//请求是否异步，默认为异步，这也是ajax重要特性
            cache:false,
            headers: {"content-type":"application/json","openid":openid},
            success:function(data){
                if(data.code){
                    alert('error:'+data.info);
                }else {

                    var ref2Arr = data.ref2Info;
                    $('#total').html(ref2Arr.length);
                    for(var i = 0;i<ref2Arr.length;i++){
                        var rand =parseInt(Math.random() * 6);
                        var infoBan=$("<div></div>").addClass('infoline_bands');
                        var infopic=$("<div></div>").addClass('infopic').appendTo(infoBan);
                        var imgHead = $('<img>',{src:'../image/head'+rand+'.jpg'}).appendTo(infopic);
                        var infotxt = $("<div></div>").addClass('infotxt').appendTo(infoBan);
                        var name = $("<div>"+ref2Arr[i].sid+"</div>").addClass('name').appendTo(infotxt);
                        var time = $("<div>"+dateFormate(ref2Arr[i].regDate)+"</div>").addClass('time').appendTo(infotxt);
                        infoBan.appendTo($('#band'));
                    }
                }
            },
            error:function(msg) {
                alert('获取数据失败,请重试!');
            }
        });
    });

</script>
<body>
<!--顶部bar-->
<div class="top">
    第<font size="+4">2</font>级推荐人
</div>
<!--顶部bar结束-->
<div class="listnum1">
    <div class="left">
        累计总数 <label id="total" style="color:red;font-weight: 600">0</label> 人
    </div>
</div>
<div id="band">
    
</div>
</body>
</html>
